package com.yiyong.myabtis_genetion.service.impl;

import com.yiyong.myabtis_genetion.core.text.Convert;
import com.yiyong.myabtis_genetion.domain.GeneratorTableColumn;
import com.yiyong.myabtis_genetion.mapper.GeneratorTableColumnMapper;
import com.yiyong.myabtis_genetion.service.IGeneratorTableColumnService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 业务字段 服务层实现
 * 
 * @author yiyong
 */
@Service
public class GenTableColumnServiceImpl implements IGeneratorTableColumnService
{
	@Autowired
	GeneratorTableColumnMapper genTableColumnMapper;

	/**
     * 查询业务字段列表
     * 
     * @param tableId 业务字段编号
     * @return 业务字段集合
     */
	@Override
	public List<GeneratorTableColumn> selectGeneratorTableColumnListByTableId(Long tableId)
	{
	    return genTableColumnMapper.selectGeneratorTableColumnListByTableId(tableId);
	}
	
    /**
     * 新增业务字段
     * 
     * @param genTableColumn 业务字段信息
     * @return 结果
     */
	@Override
	public int insertGeneratorTableColumn(GeneratorTableColumn genTableColumn)
	{
	    return genTableColumnMapper.insertGeneratorTableColumn(genTableColumn);
	}
	
	/**
     * 修改业务字段
     * 
     * @param genTableColumn 业务字段信息
     * @return 结果
     */
	@Override
	public int updateGeneratorTableColumn(GeneratorTableColumn genTableColumn)
	{
	    return genTableColumnMapper.updateGeneratorTableColumn(genTableColumn);
	}


	/**
     * 删除业务字段对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteGeneratorTableColumnByIds(String ids)
	{
		return genTableColumnMapper.deleteGeneratorTableColumnByIds(Convert.toLongArray(ids));
	}
}
